package com.huitone.gddw.utils;

import java.util.UUID;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


/**
* @Title StringUtils
* @Package com.huitone.gddw.utils
* @Description TODO
* @author chengsiyue
* @date 2017年4月25日 上午12:00:37
* @version V1.0   
*/
public class StringUtils extends org.apache.commons.lang.StringUtils {

		public static boolean isNumber(String number) {
			
			Pattern p = Pattern.compile("\\d+(.\\d+)*");
			
			Matcher m = p.matcher(number);
			
			return m.matches();
		}

		public static boolean isEmpty(String str) {
			return str == null || "".equals(str) ? true : false;
		}
		
		public static String objToString(Object obj) {
			
			String result = String.valueOf(obj);
			
			return "null".equals(result) ? "" : result;
		}
		
		public static String toString(Object obj) {
			
			String result = String.valueOf(obj);
			
			return "null".equals(result) ? "" : result;
		}
		
		public static Integer strToInteger(String str){
			
			Integer result = Integer.parseInt(str);
			
			return result;
		}
		public static double strToDouble(String str){
			
			double result = Double.valueOf(str);
			
			return result;
		}
		public static String intToString(Integer integer){
			
			String result = String.valueOf(integer);
			
			return result;
		}
       public static String longToString(long lon){
			
			String result = String.valueOf(lon);
			
			return result;
		}
		public static String douToString(double dou){
	
			String result = String.valueOf(dou);
	
			return result;
		}
		
		
		
		
		/**
		 * 生成UUID（去除中间-）
		 * @return
		 */
		public static String uuid() {
			return UUID.randomUUID().toString().replaceAll("-", "");
		}
		
		
		
		
		public static void main(String[] args) throws IOException {
			
		}
	}

